package com.kevin.learn.策略模式.基础型;

public class StrategyPatternDemo {

    public static void main(String[] args) {
        Context context = new Context(new OperationAdd());
        System.out.println("计算结果: " + context.executeStrategy(10, 5));

        context = new Context(new OperationSubtract());
        System.out.println("计算结果: " + context.executeStrategy(10, 5));

        context = new Context(new OperationMultiply());
        System.out.println("计算结果: " + context.executeStrategy(10, 5));
    }
}
